package com.itzxx.huazhun.data.dao

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey

/**
 * Desc:
 *
 * Author: zhangxiaoxiao
 * Date: 2024/8/6 18:32
 * Updater:
 * Update Time:
 * Update Comments:
 */
@Entity(tableName = "probe_record")
data class ProbeRecordEntity(
    @ColumnInfo(name = "airPressure")
    val airPressure: Int = 0,//气压传感器

    @ColumnInfo(name = "temperature")
    var temperature: Double//温度传感器
){
    /**
     * 主键
     */
    @PrimaryKey(autoGenerate = true)
    var id: Long = 0

    @ColumnInfo(name = "mac")
    var mac: String = ""

    @ColumnInfo(name = "recordStartTime")
    var recordStartTime: String = ""//开始时间

    @ColumnInfo(name = "recordSamplingInterval")
    var recordSamplingInterval: String = ""//采集间隔

    @ColumnInfo(name = "wayNum")
    var wayNum: Int = 1//通道数

    @ColumnInfo(name = "wayIndex")
    var wayIndex: String = ""//通道列表

    fun isExistTemp():Boolean{
        //气压传感器:0
        //温度传感器:1
        //湿度传感器:2
        return wayIndex.contains("1")
    }

    fun isExistAirPressure():Boolean{
        //气压传感器:0
        //温度传感器:1
        //湿度传感器:2
        return wayIndex.contains("0")
    }
}
